﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ZhouYu.DreamTour.Core
{
    public class GetKey
    {

        /// <summary>
        /// 拼接并返回Redis的Key
        /// </summary>
        /// <param name="dateTime"></param>
        /// <param name="id"></param>
        public static string GetRedisKey(DateTime dateTime,string id)
        {
            StringBuilder sb = new StringBuilder();
            sb.Append(dateTime.Year.ToString());
            sb.Append(dateTime.Month.ToString());
            sb.Append(dateTime.DayOfYear.ToString());
            sb.Append(dateTime.Hour.ToString());
            sb.Append(dateTime.Minute.ToString());
            sb.Append(dateTime.Second.ToString());
            sb.Append(id);
            return sb.ToString();
        }
    }
}
